/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package categorias;
import java.sql.*; 
/**
 *
 * @author L01085043
 */
public class categoria {
  protected Connection conn;
  protected PreparedStatement consulta;
  protected ResultSet datos; 
    private String bd;
  
  public void conectar(String servidor, String DB, String usuario, String password) throws ClassNotFoundException, SQLException{
    Class.forName("com.mysql.jdbc.driver"); 
    this.conn = DriverManager.getConnection("jdbc:mysql://"+servidor+"/"+bd, usuario, password); 
  }
  public void desconectar () throws SQLException{
      this.conn.close();
      this.conn.close();    
  } 
  public void desconectar (ResultSet rs) throws SQLException{
 this.desconectar();
 rs.close(); 
  }
 
}
